<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>
    <title>任务回收站</title>
    
    <script type="text/javascript">
	//删除
	$(document).ready(function(){
			var id;
			var userId;
			var url;
  			$(".tablelinkdelete").click(function(){
  				id = $(this).attr("id_value");
 			/* carId = $(this).attr("userId"); */
 			url =" <%= basePath%>/sys/ServiceTask_delete.action?id="+id;
 			 $(".tip").fadeIn(200);
 			 });
  
 			 $(".tiptop a").click(function(){
 			 $(".tip").fadeOut(200);
			});

  			$(".sure").click(function(){
  			$(".tip").fadeOut(100);
  					window.location.href=url;
			});

				  $(".cancel").click(function(){
				  $(".tip").fadeOut(100);
				}); 
		
	});
</script>
  </head> 
  
  <body>
  <div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">任务回收站管理</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    <div id="usual1" class="usual">
      <div id="tab2" class="tabson">
        
     	<form action="<%= basePath%>/sys/ServiceTask_opencancleTaskLisk.action" method="post"  target="rightFrame">
    	<ul class="seachform">
    	 <p:permissions right="queryUser" >
    	     <li><label>综合查询</label></li>
	    	     <li><input type="text" name="taskName" lay-verify="taskName" autocomplete="off" placeholder="任务名称" class="layui-input"></li>
	             <li><button class="layui-btn" lay-filter="chaxu" lay-submit=""/><i class="layui-icon">&#xe615;</i>查询</li>
        </ul>
        </form> 
    <table class="layui-table admin-table">
    	<thead>
    	<tr>
    		
        <th><input name="" type="checkbox" value="" checked="checked"/></th>
        <th>序号<i class="sort"><img src="" /></i></th>
		<th>任务名称</th>
		<th>分组名称</th>
		<th>指派人</th>
		<th>任务内容</th>
		<th>任务状态</th>
		<th>任务发布时间 </th>
		<th>任务完成时间</th>		
		<th>文件名称</th>		
							
        <p:permissions menu="deletetask,edittask">
        <th>操作</th>
        </p:permissions>
        </tr>
        </thead>
        <tbody>
        <s:iterator value="pageResult.data">
        <tr>
        <td><input name="" type="checkbox" value="" /></td>
        <td>${id }</td>
	    <td>${taskName}</td>
				<td>${studentGroupNameMap.get(studentGroupId)}</</td>
				<td>${TaskAssignPeopleIdMap.get(taskAssignPeopleId)}</td>
				<td>${taskContent }</td>
				<c:choose>
						  <c:when test="${0 == taskType }">
						 		 <td>未指派</td>
						  </c:when>
				  		<c:when test="${1 == taskType }">
				  			<td>进行中</td>
				  		</c:when>
				  		<c:when test="${2 == taskType }">
				  			<td>待审批</td>
				  		</c:when>
				  		<c:when test="${3 == taskType }">
				  			<td>已完成</td>
				  		</c:when>
				  		<c:when test="${4 == taskType }">
				  			<td>已取消</td>
				  		</c:when>
				  		<c:otherwise>
				  		<td></td>
				  		</c:otherwise>
					</c:choose>
				<td>${taskStateTime}</td>
				<td>${taskFinishTime }</td>
				<td>${fileNameMap.get(fileId)}</td>
        <p:permissions menu="deletetask,edittask">
        <td>
	     	<p:permissions right="edittask">
	        	<a href="<%= basePath%>/sys/ServiceTask_reductionTask.action?taskId=${taskId}" class="tablelink">
 				<button class="layui-btn layui-btn-small">
                  <i class="layui-icon"></i>还原
                </button></a>
	        </p:permissions>
        </td>
        </p:permissions>
        
        </tr> 
        </s:iterator>
        </tbody>
    </table>
    
  </div>  
       
	</div>
    
    <!-- 分页菜单组件--------------------------开始 -->
<%
//查询的url地址，统一写
String listActionURL = basePath+"/sys/ServiceTask_openList.action";
%>
    
    <script type="text/javascript">
//分页组件
function change()
  {
  var url = "<%= basePath%>/sys/ServiceTask_openList.action";                 //获取表单url
 	var textfield=document.getElementById("textfield").value;
 	var totalPage='${pageResult.totalPage}';
 	var pageNum = 0;
 	if(totalPage*1 >= textfield*1){
 		pageNum = textfield; 
 		 window.location.href  = url+"?page="+pageNum;
 	}else{
 		pageNum = totalPage; 
 		alert("当前只有"+totalPage+"页");
 	}
  	
  }
</script>
<script type="text/javascript">
var url = "<%= basePath%>/sys/ServiceTask_openList.action";                 //获取表单url
//首页
function first(){
	
   window.location.href  = url+"?page=1";
}
//上一页
function previous(){
    window.location.href  = url+"?page=${pageResult.previousPageNumber}";
}
//下一页
function next(){
    window.location.href  = url+"?page=${pageResult.nextPageNumber}";
}
//尾页
function last(){
  window.location.href  = url+"?page=${pageResult.totalPage}";
}
</script>
    <div class="pagin">
    	<div class="message">共<i class="blue">${pageResult.total}</i>条记录 	<i class="blue">${pageResult.totalPage}</i>页， 	当前显示第&nbsp;<i class="blue">${pageResult.page}</i>页</div>
        <ul class="paginList">
           <c:choose>
			   <c:when test="${pageResult.isFirst==true}"><li class="paginItem current"><a href="javascript:;">首页</a></li></c:when>
		       <c:otherwise>
			       <li class="paginItem"><a href="javascript:first()" target="rightFrame">首页&nbsp;</a></li>
		       </c:otherwise>
		   </c:choose>
           <c:choose>
		      <c:when test="${pageResult.isFirst==true}"><li class="paginItem current"><a href="javascript:;">上一页</a></li></c:when>
		      <c:otherwise>
			      <li class="paginItem"><a href="javascript:previous()" target="rightFrame">上一页&nbsp;</a></li>
		      </c:otherwise>
		   </c:choose>
           <c:choose>
			   <c:when test="${pageResult.hasNext==true}">
				   <li class="paginItem"><a href="javascript:next()" target="rightFrame">下一页&nbsp;</a></li>
			   </c:when>
		       <c:otherwise><li class="paginItem current"><a href="javascript:;">下一页</a></li></c:otherwise>
		   </c:choose>
           <c:choose>
			   <c:when test="${pageResult.isLast==true}"><li class="paginItem current"><a href="javascript:;">尾页</a></li></c:when>
		       <c:otherwise>
			       <li class="paginItem"><a href="javascript:last()" target="rightFrame">尾页&nbsp;</a></li>
		       </c:otherwise>
		   </c:choose>
        <li class="paginItem-page">
           跳转到：&nbsp;
           <input name="textfield" type="text" size="4" class="page-input" id="textfield" onchange="change()"/>&nbsp;页
        </li>
        </ul>
    </div>
<!-- 分页菜单组件--------------------------结束 -->
<script type="text/javascript"> 
      $("#usual1 ul").idTabs(); 
    </script>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</div>
	
	<div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        <div class="tipinfo">
        <span><img src="<%= basePath%>images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认删除信息 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    
	</body>
</html>
